#ifndef FORMIC_FQMC_FORTRAN_RGP_DER_HC_HEADER
#define FORMIC_FQMC_FORTRAN_RGP_DER_HC_HEADER

#include<complex>

#include<formic/exception.h>
#include<formic/fortran_mangle.h>

extern "C" {

  void FORMIC_FC_GLOBAL_(rgp_fortran_der_hc_aaaa,RGP_FORTRAN_DER_HC_AAAA)
         (   int * no,
             int * nv,
             double * tia,
             double * TVBjb,
             double * TVBaj,
             double * Bkl,
             double * Ckl,
             double * Via,
             double * Zia,
             double * ZBia,
             double * VCia,
             double * retval);

  void FORMIC_FC_GLOBAL_(rgp_fortran_der_hc_aabb,RGP_FORTRAN_DER_HC_AABB)
         (   int * no,
             int * nv,
             double * Tiajb,
             double *   Via,
             double *   Zia,
             double *   Ujb,
             double *   Yjb,
             double *   Pab,
             double *   Qab,
             double *   Ckl,
             double *   Clk,
             double *  VBia,
             double *  VCia,
             double *  ZBia,
             double *  BUjb,
             double *  CUjb,
             double *  BYjb,
             double * VBUab,
             double *  TBab,
             double * TVBjb,
             double *dVBUab,
             double *  TCab,
             double * TBUia,
             double *retval);

}

namespace formic {

namespace fqmc {

  void rgp_aaaa_der_hc(int no,
                       int nv,
                       double * tia,
                       double * TVBjb,
                       double * TVBaj,
                       double * Bkl,
                       double * Ckl,
                       double * Via,
                       double * Zia,
                       double * ZBia,
                       double * VCia,
                       double * retval)
  {
    FORMIC_FC_GLOBAL_(rgp_fortran_der_hc_aaaa,RGP_FORTRAN_DER_HC_AAAA)
      (&no, &nv, tia, TVBjb, TVBaj, Bkl, Ckl, Via, Zia, ZBia, VCia, retval);
  }

  void rgp_aaaa_der_hc(int no,
                       int nv,
                       std::complex<double> * tia,
                       std::complex<double> * TVBjb,
                       std::complex<double> * TVBaj,
                       std::complex<double> * Bkl,
                       std::complex<double> * Ckl,
                       std::complex<double> * Via,
                       std::complex<double> * Zia,
                       std::complex<double> * ZBia,
                       std::complex<double> * VCia,
                       std::complex<double> * retval)
  {
    throw formic::Exception("no implementation of formic::fqmc::rgp_aaaa_der_hc for complex numbers");
  }

  void rgp_aabb_der_hc(int no,
                       int nv,
                       double * Tiajb,
                       double *   Via,
                       double *   Zia,
                       double *   Ujb,
                       double *   Yjb,
                       double *   Pab,
                       double *   Qab,
                       double *   Ckl,
                       double *   Clk,
                       double *  VBia,
                       double *  VCia,
                       double *  ZBia,
                       double *  BUjb,
                       double *  CUjb,
                       double *  BYjb,
                       double * VBUab,
                       double *  TBab,
                       double * TVBjb,
                       double *dVBUab,
                       double *  TCab,
                       double * TBUia,
                       double *retval)
  {
    FORMIC_FC_GLOBAL_(rgp_fortran_der_hc_aabb,RGP_FORTRAN_DER_HC_AABB)
      (&no, &nv, Tiajb, Via, Zia, Ujb, Yjb, Pab, Qab, Ckl, Clk,
       VBia, VCia, ZBia, BUjb, CUjb, BYjb,
       VBUab, TBab, TVBjb, dVBUab, TCab, TBUia, retval);
  }

  void rgp_aabb_der_hc(int no,
                       int nv,
                       std::complex<double> * Tiajb,
                       std::complex<double> *   Via,
                       std::complex<double> *   Zia,
                       std::complex<double> *   Ujb,
                       std::complex<double> *   Yjb,
                       std::complex<double> *   Pab,
                       std::complex<double> *   Qab,
                       std::complex<double> *   Ckl,
                       std::complex<double> *   Clk,
                       std::complex<double> *  VBia,
                       std::complex<double> *  VCia,
                       std::complex<double> *  ZBia,
                       std::complex<double> *  BUjb,
                       std::complex<double> *  CUjb,
                       std::complex<double> *  BYjb,
                       std::complex<double> * VBUab,
                       std::complex<double> *  TBab,
                       std::complex<double> * TVBjb,
                       std::complex<double> *dVBUab,
                       std::complex<double> *  TCab,
                       std::complex<double> * TBUia,
                       std::complex<double> *retval)
  {
    throw formic::Exception("no implementation of formic::fqmc::rgp_aabb_der_hc for complex numbers");
  }

}

}

#endif
